<?php
/**
 * Created by PhpStorm.
 * User: tjjs
 * Date: 17-7-18
 * Time: 下午3:13
 */

namespace Actions;

use Data\Order_form_DAO;
use Data\Reminder_order_form_DAO;
use Utils\SysUtils;

class RestaurantReminderConfirm extends BaseAction
{
    public function doAction() {
        parent::doAction();
        // 催单id
        $reminder_id = (int)$this->data[REMINDER_ID];
        // 催单记录
        $reminder_record = Reminder_order_form_DAO::getRecord($reminder_id);
        if (!$reminder_record) {
            return $this->SendErrMsg("没有此催单记录");
        }

        $reminder_record->setREMINDER_STATUS(STATE_YES);
        Reminder_order_form_DAO::update($reminder_record);
        // 推送
        $restaurant_id=1;
        $uid_total_mng = $restaurant_id."order_mng";
        SysUtils::notifyTofFrontEnd($uid_total_mng,"确认完成",EVENT_RESTAURANT_REMINDER_CONFIRM);

        // 返回数据
        $this->ResponseDataToCurrentClient();
    }
}